local ServerOHOH = _G.ServerOHOH;
local M = ServerOHOH.class.new(script, ServerOHOH.files.Server_PlayerComponent(),script.Parent.Name);
local FavoriteReward=ServerOHOH.config.Activity[4].arg

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);

end;

function M.dtor(self)
	M.super.dtor(self);
end;

function M.FavoriteGame(self)
    local DataBase=self.parent:GetComponent(ServerOHOH.load.Server_PlayerDataComponent())
    if DataBase:GetData("favorite") then
        return false
    end
	local ItemCtrl=self.parent:GetComponent(ServerOHOH.load.Server_ItemCtrl())
    DataBase:SetData("favorite",true)
    ItemCtrl:AddItem(FavoriteReward)
    return true
end;


local function_list = ServerOHOH.function_list;

M:RegistFunction(function_list.favorite_game,M.FavoriteGame)

return M